<%
'****************************************************
' Joekoe CMS 1.2 Free      Power by Joekoe.com
' Email: info@asp126.com  asp126@qq.com
' Web: http://www.asp126.com , http://www.ude.com.cn
' Copyright (C) 2004 Asp126.com All Rights Reserved.
'****************************************************

'dim nummer,nums,rssum,page,viewpage,thepages,pageurl,sql_add
'pageurl="?"
'nummer=dim_num(0)
'nums=nummer
'sql_add=""

'sql="select count(id) from table"
'set rs=joekoe_cms.exec(sql,1)
'rssum=rs(0)
'rs.close
'call format_pagecute()
'sql="select top "&nummer*viewpage&" * from table order by id desc"
'call joekoe_cms.exec("",-1)
'rs.open sql,conn,1,1
'if int(viewpage)>1 then rs.move (viewpage-1)*nummer
'if int(viewpage*nummer)>int(rssum) then nums=nummer-(viewpage*nummer-rssum)
'for i=1 to nums
'  response.write type_view()
'  rs.movenext
'next
'rs.close

'set rs=nothing

sub format_pagecute()
  if rssum mod nummer > 0 then
    thepages=rssum\nummer+1
  else
    thepages=rssum\nummer
  end if
  page=trim(request("page"))	'page=trim(request.querystring("page"))
  if not(isnumeric(page)) then page=1
  if int(page)>int(thepages) or int(page)<1 then
    viewpage=1
  else
    viewpage=int(page)
  end if
end sub

'****************************************************
' Joekoe CMS 1.2 Free      Power by Joekoe.com
' Email: info@asp126.com  asp126@qq.com
' Web: http://www.asp126.com , http://www.ude.com.cn
' Copyright (C) 2004 Asp126.com All Rights Reserved.
'****************************************************
%>